<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>基本对象定义</title>
    <script>
      let title = "ES6从入门到学会";
      let price = 25;
      let publish = "小马出版社";

      let book = {
        title,
        //等同于title: title
        price: price,
        publish,
        toString() {
          console.log(`<<${this.title}>> is ${price}元。`);
        },
        // 等同于toString: function ()...
      };
      book["lang"] = "简体中文";

      console.log(book);
      book.toString();
    </script>
  </head>
  <body></body>
</html>
